<div class="layui-card">
    <div class="layui-card-body">
        <div>
            <form action=""  class="layui-form">
                <div class="layui-form-item">
                    <div class="layui-input-inline">
                        <input type="text" name="keywords" value="{$search.keywords}" class="layui-input" placeholder="用户名|手机号|电子邮箱">
                    </div>
                    <div class="layui-input-inline">
                        <select name="is_admin" >
                            <option value="">管理员</option>
                            <?php
                             ?>
                            <option value="1" {eq name="$search.is_admin" value="1"}selected{/eq}>是</option>
                            <option value="0" {eq name="$search.is_admin" value="0"}selected{/eq}>否</option>
                        </select>
                    </div>
                    <div class="layui-input-inline">
                        <button class="layui-btn" lay-submit lay-filter="formDemo">搜索</button>
                    </div>
                </div>
            </form>

            <form action="{:url('admin/user.index/deluser')}" method="post" class="layui-form delete-form" id="cp-form">
                <div class="layui-btn-group">
                    <a href="{:url('admin/user.index/adduser')}" class="layui-btn layui-btn-xs">
                        <i class="layui-icon layui-icon-addition"></i>
                        创建用户
                    </a>
                    <button type="submit" class="layui-btn layui-btn-xs layui-btn-danger ">
                        <i class="layui-icon">&#xe640;</i>
                        删除用户
                    </button>
                    <a href="{:url('admin/user.index/excel')}" class="layui-btn layui-btn-xs">
                        导出Excel
                    </a>
                    <span class="layui-badge-rim layui-btn layui-btn-xs">用户人数：{$userList->total()}</span>
                </div>
                <table class="layui-table">
                    <thead>
                    <tr>
                        <th width="10">
                            <input type="checkbox" class="layui-input"  lay-skin="primary" lay-filter="select-all">
                        </th>
                        <th width="120">用户名</th>
                        <th>联系手机</th>
                        <th>邮件地址</th>
                        <!--<th >登陆次数</th>
                        <th >IP地址</th>
                        <th >登陆时间</th>
                        <th >上次登陆时间</th>
                        <th >上次登陆ip</th>
                        <th width="120">访问token</th>
                        <th width="120">访问钥匙</th>
                        <th >注册时间</th>
                        <th >更新时间</th>-->
                        <th>积分</th>
                        <th>管理员</th>
                        <th >状态</th>
                        <th >操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    {volist name="userList" id='v'}
                    <tr>
                        <td align="center" valign="middle">
                            <input type="checkbox" name="idList[]" class="layui-input" lay-skin="primary" value="{$v.id}">
                        </td>
                        <td>{$v.username}</td>
                        <td>{$v.phone}</td>
                        <td>{$v.email}</td>
                        <!--<td>{$v.login_times}</td>
                        <td>{$v.login_ip}</td>
                        <td>{$v.login_time|date="Y-m-d"}</td>
                        <td>{$v.last_login_time|date="Y-m-d"}</td>
                        <td>{$v.last_login_ip}</td>
                        <td>
                            <p style="width: 80px;height: 40px;overflow: hidden">{$v.access_token}</p>
                        </td>
                        <td>
                            <p style="width: 80px;height: 40px;overflow: hidden">{$v.access_secret|default=''}</p>
                        </td>
                        <td>{$v.create_time|date="Y-m-d"}</td>
                        <td>{$v.update_time|date="Y-m-d"}</td>-->
                        <td>{$v.score}</td>
                        <td>
                            <input type="checkbox" value="{$v.id}"  data-url="{:url('admin/user.index/edituser')}"  name="is_admin" lay-filter="is_admin" lay-skin="switch" lay-text="启用|禁用" {eq name="$v.is_admin" value="1" }checked{/eq}>
                        </td>
                        <td>
                            <input type="checkbox" value="{$v.id}"  data-url="{:url('admin/user.index/edituser')}"  name="status" lay-filter="status" lay-skin="switch" lay-text="启用|禁用" {eq name="$v.status" value="1" }checked{/eq}>
                        </td>
                        <td>
                            <a href="{:url('admin/user.index/edituser',['id'=>$v['id']])}" class="layui-btn layui-btn-xs layui-btn-danger ">
                                <i class="layui-icon layui-icon-edit"></i>
                                编辑
                            </a>
                            <a data-id="{$v.id}" data-url="{:url('admin/user.index/resetuserpwd')}" class="layui-btn layui-btn-xs reset-pwd">
                                密码重置
                            </a>
                            <a  href="{:url('admin/user.index/readuser',['id'=>$v['id']])}" class="layui-btn layui-btn-xs">
                                详情
                            </a>

                            <a  data-href="{:url('admin/user.index/score',['user_id'=>$v['id']])}" class="layui-btn layui-btn-xs score">
                                积分充值
                            </a>
                        </td>
                    </tr>
                    {/volist}
                    </tbody>
                </table>
            </form>
            {$userList|raw}
        </div>
    </div>
</div>